from django.contrib.auth import logout
from django.contrib.auth.decorators import login_required
from django.core import serializers
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.utils import simplejson
from optitrans.domain.arret import Arret
from optitrans.domain.vehicule import Vehicule

@login_required
def home(request):
    vehicules = Vehicule.objects.all();
    geodata =  serializers.serialize('json', vehicules);
    return render_to_response('pages/home.html', {'vehicules':vehicules,'geodata':geodata}, context_instance=RequestContext(request))
   


@login_required
def config(request):
    return render_to_response('pages/configuration.html')


@login_required
def rapport(request):
    return render_to_response('pages/rapport.html')


@login_required
def gestion(request):
    return render_to_response('pages/gestion.html')



   


